@model string
@using NITASA.ViewModels
@{
    CL_WidgetOption wOption = NITASA.Helpers.Functions.ParseJson<CL_WidgetOption>(Model);
    List<CL_Content> RecentViewPosts = NITASA.Helpers.Functions.GetRecentViewPosts(wOption.Count);
}

@if (RecentViewPosts.Count() > 0)
{
    <h6 class="sidebartitle">@wOption.Title</h6>
    foreach (var item in RecentViewPosts)
    {
        if (wOption.showthumb)
        {
            <div class="avatar">
                <img src="@(!string.IsNullOrEmpty(item.FeaturedImage) ? item.FeaturedImage : "/Content/postdefult.png")" style="width:36px;height:36px;" alt="" />
		    </div> 
        }
        <p>
            <a href="/Content/@item.URL">@item.Title</a>
			@*@NITASA.Helpers.Functions.FormatDate(item.PublishedOn, "dd MMM yyyy")*@
		</p>
		<p>
            @{string Description = NITASA.Helpers.Functions.RemoveHTMLTags(item.Description);}
			@(Description.Length > 110 ? Description.Substring(0, 110) + "..." : Description)
		</p>
    }
    <br class="clear" />
}
